import { ViewChild } from '@angular/core'
import { STPage, STWidthMode, STComponent, STChange } from '@delon/abc'
import { ISearchSchema } from '@shared/interfaces/search'
import { ESearchType, EUserType, ERoleType } from '@shared/enums'
import { IQueryParams } from '@shared/interfaces/queryParams'
import { IPagination } from '@shared/interfaces/pagination'

export class StClass {

  /* 页码 */
  public pi = 1

  /*  每页展示的数据量*/
  public ps = 10

  /* 总数，显示在底部 */
  public total: number

  /* 数据 */
  public data: any[]

   /* 底部导航栏配置 */
  public stPage: STPage = {
    front: true,
    total: true,
    showQuickJumper: true,
  }

  /* 表格宽度模式 */
  widthMode: STWidthMode = {
    type: 'strict',
    strictBehavior: 'truncate',
  }

  /* 滚动属性 */
  scroll = {
    x: '300px'
  }

  loading = false

  constructor(options?: IPagination) {
    if (options) {
      this.pi = options.page
      this.ps = options.size
    }
  }

  reset() {
    this.pi = 1
  }
}
